﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using System.IO;

namespace PasswordControl
{
    public class StoreData
    {
        static private readonly string PATH = ControlProgram.DEFAULT_SETUP_FILE;

        static private StoreData m_dataClass = new StoreData();

        /* Variables */
        public string DefaultProfile { get; set; }

        private bool m_defaultDisplay = true;

        //private bool m_defaultContain = true;

        //load-save data
        static public void SaveData()
        {
            DataSerialize.SaveData<StoreData>(m_dataClass, PATH);
        }
        static public void LoadData()
        {
            if (File.Exists(PATH))
            {
                m_dataClass = DataSerialize.LoadData<StoreData>(PATH);
            }
        }

        //get-set default profile
        static public void SetDefaultProfile(string profile)
        {
            m_dataClass.DefaultProfile = profile;
        }

        //set default display
        static public void SetDefaultDisplay(bool display)
        {
            m_dataClass.m_defaultDisplay = display;
        }
    }
}
